PureBasic Survival Guide XXIX - Projects
PureBasic Survival Guide
a tutorial for using purebasic for windows x.xx

Part 0 - TOC
Part I - General
Part II - Converts
Part III - Primer I
Part IV - Primer II
Part V - Advanced
Part VI - 2D Graphics I
Part VII - 2D Graphics II
Part X - Assembly
Part XI - Debugger
Part XII - VirtualBox
Part XIII - Databases
Part XIV - Networking
Part XV - Regular Expressions
Part XVI - Application Data
Part XVII - DPI
Part XXVII - Irregular Expressions
Part XXIX - Projects
 

Part XXIX - Projects
v10 22.09.2021

Utilities

29.101 Wakiewakie
29.102 WallX
29.103 SQB
29.104 WaitWindow

Coding related

29.201 CodeCaddy
29.202 REval
29.203 td_lib
29.204 x_lib

Discontinued

29.301 Runalot
29.302 Sweetspot
 


29.0 Projects & Applications
 

Utilities

A few applications that I wrote and may be useful to others.

Coding related

These programs are specifically related to programming, or to PureBasic itself.


Experimental or discontinued

Stuff I fooled around with, or plan to return to some day...


29.101 Wakiewakie
 


 

What it is

A WOL tool aimed at HTPC owners, or users of other client / server setups that require a server to wake up.

Primary difference between Wakiewakie and other WOL tools is ease of configuration, detection of assigned IP addresses, and a (self adjusting) progress indicator.

What it does

  1. Makes sure the local (client) machine has a valid address
  2. Ping some always on device (typically a router)
  3. Send a WOL to a certain mac address (typically the network card of the machine to wake up)
  4. Ping the server (to make sure it's awake)
  5. Return control to the user (or a batch file)
  6. Create a desktop shortcut with all options set


Download


Installation

Just start the executable.When using the 'history' option Wakiewakie will create one additonal file called wakiewakie.his in the same folder as the executable.
 

Documentation

There is a build-in and external (text) help file, and all fields have tool-tips.
 

Additional information


29.102 WallX
 


 

What it is

A wallpaper tool (not a wallpaper manager!) aimed at multi monitor setups and virtual machines.

WallX is a small utility I wrote after fooling around with VirtualBox. Originally it created backgrounds 'on the fly' allowing quick identification of different VM's, but it changed over time and can now display random wallpapers on any multi-monitor setup, regardless of resolution or position.Scroll down to see 'dual monitor auto resizing auto cropping wallpaper' in action...

Update. WallX is now at version 2.10x, and supports Windows 10. It also received a bunch of (internal) updates for better handling of multi monitor setups with (semi) random images, rounded corners (don't we all want them) as well as shortcuts and drag-and-drop support.


 

What it does

  • Pick random images from a folder with wallpapers and smartly adjust them to your multi monitor setup
  • Add image effects on the fly
  • Auto crop / stretch loaded wallpapers to match any combination of monitors, up to ten (!)
  • Create background images for better identification of multiple machines, for example VM's
  • Detects IP and screen changes when in resident mode
  • Runs on Windows98, XP 32, Vista 64, Windows 7, 8, 10
  • Support for custom presets and preference lists


Download


Installation

Unpack and copy the file wallx.exe to a comfy place. Starting the program without any command line options will bring up a little help screen.
 

Documentation

There is a build-in and external (text) help file, and all fields have tool-tips. Start the program without any command line options, or use the option 'help' and you will get a little help screen.

Remember to add 'start' if you want to run resident.
 

Additional information

v1.91 on Windows 10:

v1.70 on Windows XP:

Here are some example images created with WallX:

wallx.exe blue mark "MEDIASERVER" resident

wallx.exe base dots text "BASE IMAGE | WIN 98 SE UK | NOT FOR REGULAR USE | ~host~ ~ip~"

wallx.exe red big 1

wallx.exe traffic fade big 2 dots text "MAIL SERVER | ~host~ - ~ip~"

And two examples of multi monitor wallpapers with transparent text superimposed:

wallx.exe monitor 0 load c:\software\wallpaper\an_evangelion.jpg monitor 1 load c:\software\wallpaper\an_eureka7_1.jpg monitor all transparent big ~ip~ text "TEST | ~host~ ~ip~ " 

wallx.exe load c:\software\wallpaper\2h_mountain_lake.jpg dots transparent big ~desktop~ text "MONITOR ~desktop~ | ~timestamp~" fade

Rounded corners? We got you covered as of v1.92 :-)


29.103 SQB
 


 

What it is

A .M3U playlist manager / tool which can also can export folders and playlists as .mp3 collections (using Sox).

With this you can manage your playlists, and export and convert (all songs on) a playlist to easily copy them to, for example, a portable MP3 player, a phone, or a memory stick or card to use in your car. Especially useful for those who sometimes rename their music files, or have a device that doesn't play .mp3 songs. If you have a car or music player that doesn't handle playlists or .flac files, then this is for you!


 

What it does

  • Check and modify (SqueezeBox) .M3U playlists
  • Help detecting missing files
  • Simplify exporting and converting all songs in a playlist to a specific folder


Download


Installation

  • Unpack and copy the SQB folder anywhere you like.
  • Run SQB.exe.
  • Make sure to set all proper paths on the preferences tab.


Documentation

  • More information can be found in the embedded and enclosed help file
  • Note that SQB uses Sox for FLAC to MP3 conversion, see the Sox folder for more details on Sox
  • Most MP3 patents have expired by now, except for the US, where the final patent will expire December 2017
  • Sox requires some additional DLL's to handle MP3's, they are included
  • You're not allowed to use these DLL's in the US, but you could rebuild the DLL's or Sox itself using the source which is freely available on the Internet
  • Do you know about EncSpot?


Other information


 
 


29.104 WaitWindow
 


 

What it is

A simple command for batch files to test for open / closed windows.
 

What it does

  • Commandline tool to wait for (the existence of) a window
  • Use 'waitwindow help' for all commandline options


Download


Installation

    Copy somewhere into your path
Documentation
  • Use 'waitwindow help' for all commandline options
  • Syntax: waitwindow <windowname> [<timeout>] [<action>] [<commandline>]
  • Timeout:
    • 0 - no timeout (wait forever)
    • n - wait n seconda
  • Action: open | wait | waitforopen - default, wait until the specified window is open
    • close | waitforclose - wait until the specified window is closed
    • openclose | waitforopenandclose - wait until the specified window is open, then closed again
    • ifnot | runifnotopen - execute commandline if the window isn't open, wait until done
    • start | startifnotopen - execute commandline if the window isn't open, do not wait until done
  • Example:
    • waitwindow purebasic* - wait until a window 'purebasic...' is open
    • waitwindow balabolk* 10 open - wait until balabolk... is open, or 10 seconds have passed
    • waitwindow squeeze* 1 ifnot squeezeplay.bat - start squeezeplay if window isn't open
    • waitwindow obs* 1 start "C:\Program Files\obs-studio\bin\64bit\obs64.exe" - avoid multiple instances of obs

29.201 CodeCaddy
 


 

What it is

Who's your daddy? CodeCaddy! An add-on for the Purebasic IDE, that even The Hoff would use!

  • In silly words: CodeCaddy is an instant context related reference search tool, backup assistent, multiline construction enhancement and code synchronizer / reformatter. Pfff.
  • In real language: a smart search that looks in your current code as well as all other files, and shows the results in a seperate window. Plus, it brings a couple of tools along.
I'm not sure if CodeCaddy did inspire the Purebasic devs to improve their IDE (but it's nice to flatter oneself) or if great minds think alike (which in my case would then also apply to small minds :-)) but most of the features of CodeCaddy have made it in this or some other form into the IDE. I still use CodeCaddy for its backup mechanism, look-up feature, and 'unused' code stripper.


 

What it does

  • looks for any occurancies of specified code or keywords in all sorts of files
  • create numbered backups (jaPBe style with a little pizzaz) in a dedicated backup folder using .cdy and .bak files
  • installs itself in the PureBasic IDE tools menu, but only if you tell it to
  • synchronizes two folders taking .cdy .pb .bak files in account (good for bringing your code with you)
  • adds build date, build number and save number constants on compilation time (like PureBuild, only better ;-))
  • flatten multiline sections, ie. lines ending on '_'
  • searches the web from within the PureBasic IDE
  • removes unused code before compilation
  • free, indefinitely
If you really really really want to compare CodeCaddy with other tools, it's a little of...
  • PureBuilder
  • CodeArchive search
  • Constant explorer
  • Code reformatter
  • Alt+F1
... all rolled into one. Sort of. In fact, I never felt the need for any of the above since I wrote CodeCaddy :-)
 

Download


Installation

Did I mention there was some documentation inside the download? :-) Anyway, there are several ways to try CodeCaddy, and eventually install it. Here are a few options...
 

The 'lazy' way

CodeCaddy can install itself if you want, more for the lazy people:

  1. download codecaddy.zip
  2. unpack, copy codecaddy.exe in your PureBasic folder
  3. run it
  4. use the menu option Tools / Install in IDE


The 'I wanna' know all' way

  1. download codecaddy.zip
  2. unpack, copy codecaddy.exe in your PureBasic folder
  3. run it
  4. press the help button
  5. follow the instructions


The 'I love my DOS box' way

  1. download codecaddy.zip
  2. unpack, copy codecaddy.exe in your PureBasic folder
  3. open a command box / dos box / shell prompt whatever
  4. cd to your purebasic folder
  5. execute: codecaddy find "<pb file name>" "<search phrase>"


The 'I don't trust you with my editor preferences anyway' way.

  1. download codecaddy.zip
  2. copy codecaddy.exe into your pb folder
  3. run codecaddy.exe
  4. select the menu Options / Preferences
  5. go to the tab Search
  6. select the top 'asterix' button (the one behind the 'Basic' section)
  7. select your PB folder, or a folder where you save all your PureBasic source files (anything ending on .pb will do)
  8. leave preferences with Ok
  9. hit the F2 key (search)
  10. enter the first letters of a procedure or variable name that you know of
  11. hit Start

  12. in the resulting window the top half shows all hits, the bottom half shows the related code


Documentation

  • On-board documentation
  • Example usage in flash (can be viewed from within CodeCaddy)...
  • Horrible download or youtube video showing how to use it. (Apologies for the quality, and make sure you buy the FireFly DVD afterwards!)


Additional information
 

The Hoff

For more information on The Hoff, go here... Don't forget to ask :-)
 

Compatibility

CodeCaddy has been used extensively in writing CodeCaddy :-) CodeCaddy itself was originally written in PureBasic 4.4x (but I've been recompiling it on any version of Purebasic ever since), and works on:

  • Windows XP
  • Windows Vista
  • Windows 7
  • Windows 8
  • PureBasic 3.94
  • PureBasic 4.xx 5.xx (thus far on all versions)
I dropped Windows 98.
 

Example use

  • How did I name that variable?
      1. from inside the PB IDE, first start CodeCaddy with [Control]+[F1]
      2. then hit [Control]+[F] (tell CodeCaddy to search for a certain term)
      3. enter the search phrase and hit [Enter]
      4. CodeCaddy will list all occurances in your current code, in your includes, and in any other paths if specified
      5. CodeCaddy will colour code and categorize the results, so you can easily spot procedures, structures, constants and variables
      6. you can scroll through the results using the up/down key, and the found match will be shown in it's context

      7.  
  • I need to look up an example of a keyword / function...
      1. inside the PB IDE, move the cursor on top of the word you're looking for
      2. then hit [Control]+[F1]
      3. and CodeCaddy will list all matches, and you can easily view details on each of them
      4. (and suddenly it's a good idea to put some remarks in your collection of procedures at the start of each procedure :-))

      5.  
  • I need to look up an example of a keyword / function on the InterNet...
      1. inside the PB IDE, move the cursor on top of the word you're looking for
      2. then hit [Alt]+[F1]
      3. and CodeCaddy will launch your browser and specified searches

      4.  
  • What was the value of that constant again?
      1. as before, nothing to stop you from including a file with PB or Windows constants, or any other text file
      2. so start CodeCaddy, hit the [Control]+[F] and enter that phrase
      3. CodeCaddy splits the search in two stages, it halts between these two stages, waiting for a keypress to continue
      4. you can specify additional files or paths in CodeCaddy under Options / Preferences / Search...
      5. ... include, for example, files with PB constants, or a C compiler's .h file, or anything else in Ascii
  • My code is all messy! Let's clean it up then!
      1. then let's reformat your code!
      2. inside the PB IDE, hit [Alt]+[R]...
      3. ... and all code will be nicely indented
  • Keeping track of version and build numbers is easy...
      1. CodeCaddy keeps automatically track of each build and version by storing some information in a .CDY file...
      2. ... which is updated on every save and every build
      3. use two special constants to use this information inside your program
  • Maintaining multiple backups so I won't accidentally overwrite my (older, working) source code is a chore. No, it's not!
      1. CodeCaddy automatically creates backups of your source file in a dedicated folder
      2. and numbers each backup subsequently, so you can return to an older version of your source even after multiple edits and runs
  • Can I bring my sources with me? And stop worrying about overwriting a newer version with some older code once I start lugging code around?
      1. define two folders in CodeCaddy (Options / Preferences / Other/ CodeSync)
      2. hit [F9] and both will be synchronized
      3. CodeCaddy will ask you for confirmation if it can't figure out what is the latest version (using not only the timestamp but also information in the associated .CDY files)
To be honest, I find it very hard to explain. Just use it and see for yourself, move the cursor over something you need to know more about, and hit [Control]+[F1] or [Alt]+[F1]and watch the magic.
 

Screenshots

CodeCaddy on Windows XP classic.

Some fields in the Preferences window.

CodeCaddy on Windows XP 'themed'.


29.202 REval
 


 

What it is

REval is a simple Regular Expression tool I often use to validate regular expressions in my code. As reval is writtin in PureBasic using the same regular expression engine I know the results in my code will match those in REval.


 

What it does

  1. Type your regular expression in the top bar, and type or paste the lines you want to test in the bottom box.
  2. If the regular expression is a valid one a green square will light up, and if any of the 'test subjects' qualify they will be hightlighted.


Download


Installation

Just run it.
 

Documentation


29.203 TD_lib
 

What it is

A collection of algoritms related to thermo dynamics.
 

What it does

Interested in thermo dynamics? Well, I'm definitely not, but I needed some formulas for my work. This file contains a number of collected routines, scavenged from the web, and converted to PureBasic. All credits go to Schlatter / Baker / Kuemmel / Strijk and many others, listed in the source. Any mistakes are likely mine.

Criticasters may notice that my conversion to PureBasic is anything but efficient, I've just tried to stay as close as possible to the original Fortran code to simplify debugging using the included examples of Schlatter and Baker. And as I know close to nothing about Fortran and even less about thermo dynamics you can see my problem... Use at your own risk.

The full conversion is not entirely done, I think I've done 70% or so, which included all the routines I needed. Feel free to work on the remainder :-)
 

Download

  • Download tdlib.zip - source code with some examples


Additional information

This is not a .lib file but a regular PureBasic include file.


29.204 X_lib
 

What it is

A collection of different procedures I use in several projects.
 

What it does

Not much by itself.
 

Download

I do not maintain a seperate x_lib archive. If you need the latest version, please download CodeCaddy and copy the appropriate folder(s) from the source.
 

Additional information.

  • This is not a .lib file but a regular PureBasic include file.
  • This code is not multi-threading safe.

29.301 Runalot
 

What it is

Discontinued.


 

What it does

Little tool to open a set of URL's at once. I used this in the past to hunt Ebay and Marktplaats for bargains, and open a few of my favorite websites as well.
 

Download

  • Download runalot.zip - source code with some examples



29.302 Sweetspot
 

What it is

Discontinued.
 

Download